package net.esj.basic.expression.condition.logic;

import net.esj.basic.expression.condition.BaseCondition;
import net.esj.basic.expression.condition.Condition;

public abstract class AbstractConditionLogic extends BaseCondition {
	
	protected Condition[] conditions = EMPTY_CONDITIONS;
	
	public void addCondition(Condition cond) {
		if(conditions == null || conditions == EMPTY_CONDITIONS)
		{
			conditions  = new Condition[]{cond};
		}
		else
		{
			int len = conditions.length;
			Condition[] tmp = new Condition[len + 1];
			System.arraycopy(conditions, 0, tmp, 0, len);
			tmp[len] = cond;
			conditions = tmp;
		}
	}

	public AbstractConditionLogic() {
		super();
	}
	
}
